const path = require("path");
let parentDir = path.resolve(path.dirname(__filename), "../");
/*
使用：  const result = await ico["user"].findAll({where: {字段}, }) || [];
*/
//实现类似ico
const AllEntityList = {};
require("require-all")({
  dirname: parentDir + "/entity",
  filter: /(.+)\.js$/,
  recursive: true,
  resolve: function (entity) {
    AllEntityList[entity["name"]] = entity;
  },
});
module.exports = AllEntityList;
